Copyright: Copyright (c) 1994 By Johnathan Mark Smith


Contents
JS-TIPS FOR VISUAL BASIC

Contents

About JS-Tips for Visual Basic

Tip for November: How to make your Visual Basic program exit windows.

Tip for December: How to Make your program exit windows then run a DOS program in DOS then restart windows.

Advertising

Back Issues

Listings

How to get JS-Tips for Visual Basic


About
About JS-Tips for Visual Basic

JS-Tips for Visual Basic is a bi-monthly tip sheet in the form of a windows help file.

JS-Tips is a way for Visual Basic programmers to give tips and tricks to other

Visual Basic programmers.

Feel free to send your Tips, Questions or Suggestions to:

Johnathan Mark Smith

569 Lamoka Ave.

Staten Island, NY 10312

You will not get cash for your tips !

The only thing you will receive is your name in the help file

and a free copy of the help file.

Disclaimer

By sending in your tip you are releasing it as public domain.

This means you can not make any financial cliam to it.

Anyone reading this help file can use and code or suggestions

in any manner they like, including the author of JS-Tips.


 Advertising

For information about advertising in JS-Tips for Visual Basic,

Contact :

Johnathan Mark Smith

569 Lamoka Ave

Staten Island, NY 10312


Back Issues

To order back issues, contact :

Johnathan Mark Smith

569 Lamoka Ave

Staten Island, NY 10312

Back Issues cost $7 each.


Listings

You can get this months tip programs sent to you ready to run for just $10.

Send your check to:

Johnathan Mark Smith

569 Lamoka Ave

Staten Island, NY 10312


How to get
How to get JS-Tips for Visual Basic

You can send $20 to

Johnathan Mark Smith

569 Lamoka Ave

Staten Island, NY 10312

For your $20 you will get 6 copies of JS-Tips for Visual Basic bi-monthy and

at the end of the year we will send you one help file with all the tips for the year on it.

Also, if you send in your check NOW you will get a free copy of JS-CLIP.

JS-CLIP is a windows program to help you clip parts of your screen in to the

windows clipboard.


November
November 1994: How to Make your Visual Basic program exit windows.

1) Make a new Project.

2) On form1 add one command button.  Make the form look like the one below.

3) Add the following code to the general part of your form.

Declare Function ExitWindows Lib "User" (ByVal dwReturnCode As Long, ByVal wReserved As Integer) As Integer

The two lines above must be typed in on one line !

4) Add the following code to your command button.

Sub Command1_Click()

Dim X

X = ExitWindows(0,0)

End Sub

5) Save your project then run it.

 TIP BY:  Johnathan Mark Smith


December
December 1994: How to Make your program exit windows then run a DOS program in DOS then restart windows

Some DOS programs can not be shell to like mainframe to PC software.  The following source code will show you how to run DOS programs from within your Visual Basic program

1) Make a new Project.

2) On form1 add two labels, two text boxes and one command button.

    Make the form look like the one below.

3) Add the Following code to the general part of your form.

Declare Function ExitWindowsExec Lib "User" (ByVal lpszExe As String, ByVal lpszParams As String) As Integer

4) Add the following code to your command button.

Sub Command1_Click()

DIM X

X = ExitWindowsExec(Trim(Text1.Text), Trim(Text2.Text))

End Sub

5) Save your project then run it.

6) Try Typing in for the program name C:\DOS\EDIT.COM.(IN TEXT1 TEXTBOX)

7) Click on the button and see the DOS editor run.

TIP BY:  Johnathan Mark Smith